package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        try{
           /* System.out.println("程序开始了");
            String str =null;
            System.out.println(str.length());
            System.out.println("!!!!!");*/
            /*String str1 = "abc";
            System.out.println(str1.charAt(5));*/
            String str="abc";
            System.out.println(Integer.parseInt(str));
        }catch(NullPointerException e){
            System.out.println("出现了空指针,并处理完毕了");
        }catch (StringIndexOutOfBoundsException e){
            System.out.println("出现了字符串下标越界异常,并处理完毕了");
        }catch(Exception e){
            System.out.println("出了个错");
        }

    }

}
